Fix cryptic curl error in CLI E2E AspireStartAsync when dashboard URL is empty#16061
Fix cryptic curl error in CLI E2E AspireStartAsync when dashboard URL is empty#16061
Conversation
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/750205bd-83b5-4cca-bfe1-65c59cd74ca8 Co-authored-by: radical <1472+radical@users.noreply.github.com>
When $DASHBOARD_URL extraction from aspire start JSON output fails, the curl call receives an empty string and produces a cryptic error: curl: (3) URL rejected: Malformed input to a URL function This change detects the empty URL via the existing "dashboard-url-empty" echo and throws a clear InvalidOperationException with diagnostic guidance, instead of falling through to the curl call. Fixes the failure pattern seen in: https://github.com/microsoft/aspire/actions/runs/24276013064/job/70890264300 Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/750205bd-83b5-4cca-bfe1-65c59cd74ca8 Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
/create-issue --test "Aspire.Cli.EndToEnd.Tests.PythonReactTemplateTests.CreateAndRunPythonReactProject" --url https://github.com/microsoft/aspire/actions/runs/24276013064/job/70890264300?pr=16059 |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16061Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16061" |
There was a problem hiding this comment.
Pull request overview
This PR improves failure diagnostics in the CLI E2E test harness by turning an empty dashboard URL (caused by failed JSON extraction) into a clear, actionable exception instead of a cryptic curl error.
Changes:
- Detects the
dashboard-url-emptymarker and throws a clearInvalidOperationExceptionbefore attempting thecurlverification. - Updates the empty-dashboard-URL guard comment to reflect the new fail-fast behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs | Adds fail-fast detection for empty dashboard URL extraction to avoid cryptic curl failures. |
| tests/Aspire.Cli.EndToEnd.Tests/PythonReactTemplateTests.cs | No functional change (whitespace). |
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs
Outdated
Show resolved
Hide resolved
JamesNK
left a comment
There was a problem hiding this comment.
1 issue found (bug): early return from WaitUntilAsync races with diagnostic output capture.
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2EAutomatorHelpers.cs
Outdated
Show resolved
Hide resolved
|
/create-issue Aspire.Cli.EndToEnd.Tests.PlaywrightCliInstallTests.AgentInit_WhenCwdDiffersFromWorkspaceRoot_PlacesSkillFilesInWorkspaceRoot https://github.com/microsoft/aspire/actions/runs/24378739594 |
Remove `return true` so the WaitUntilAsync predicate continues waiting for the shell prompt after setting the dashboardUrlEmpty flag, ensuring all diagnostic output is captured before throwing. Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/45bf6bc5-0c92-4296-95ed-7cfa235e9dbb Co-authored-by: radical <1472+radical@users.noreply.github.com>
Fixed in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
❌ Run 24378739594 belongs to workflow 'Outerloop Tests', not 'CI'. |
|
❌ The |
The CellPatternSearcher was matching 'dashboard-url-empty' in the typed
command text (echo 'dashboard-url-empty') rather than in actual shell
output, causing the test to always think the URL was empty.
Replace with a separate echo command using variable expansion so the
typed text (${DASHBOARD_URL}) differs from the expanded output. The
pattern URLCHECK::URLEND only appears when the URL is truly empty.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🎬 CLI E2E Test Recordings — 71 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24421597840 |
Description
Fixes the cryptic
curl: (3) URL rejected: Malformed input to a URL functionerror in CLI E2E tests by detecting an empty dashboard URL early and throwing a clearInvalidOperationExceptionbefore thecurlcall.Problem
The
AspireStartAsynchelper in CLI E2E tests extracts the dashboard URL fromaspire start --format jsonoutput usingsed. When the extraction fails (thedashboardUrlfield is missing or in an unexpected format),$DASHBOARD_URLis empty. The existing code has anif [ -z "$DASHBOARD_URL" ]guard that dumps diagnostic logs when the URL is empty, but then falls through to thecurlcall with the empty URL, producing the cryptic error:This pattern was seen in: https://github.com/microsoft/aspire/actions/runs/24276013064/job/70890264300?pr=16059
Fix
Instead of falling through to curl after detecting the empty URL, the code now:
dashboard-url-emptyecho marker in the terminal output (from the existing empty-URL guard)cat,ls -lt,tail) is fully captured in the terminal recordingInvalidOperationExceptionwith a clear message explaining that the dashboard URL extraction failedcurlverification if the URL was successfully extractedThis makes failures due to empty dashboard URLs produce clear, actionable error messages with full diagnostic context, instead of the cryptic curl error.
Validation
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: